package exdate;

import java.time.LocalDate;
import java.time.LocalTime;

/**
 * @author: knowno
 * @create: 2025-09-15 09:33
 * @Version 1.0
 **/
public class TestLocalTime {
    public static void main(String[] args) {
        //1 创建本地日期对象 LocalTime.now()
        LocalTime time = LocalTime.now();
        System.out.println(time);
        //获取时
        int hour = time.getHour();
        System.out.println(hour);
        //获取分
        int minute = time.getMinute();
        System.out.println(minute);
        //获取秒
        int second = time.getSecond();
        System.out.println(second);
        //获取纳秒
        int nano = time.getNano();
        System.out.println(nano);

        //2 创建指定日期对象 LocalDate.of()
        LocalTime of = LocalTime.of(12, 00, 15);
        System.out.println(of);
    }
}
